Overview

You have already cloned the GitHub repository to a local repository in your machine's workspace directory. You have also created a Kotlin project with the name Little Lemon . Inside it, you created an Android Jetpack Compose app named Little Lemon . In this exercise, you’ll take the next step and commit the project to the remote repository on GitHub.

Scenario

By setting up a Jetpack Compose project for Little Lemon and cloning a repository, you’ve established the framework for developing your Little Lemon food ordering app. Before you do so, you should practice the procedure for committing a project to the remote repository, as this is something you’ll do regularly over the course of the project.

Instructions

Step 1: Create a new branch of local repository

Open the terminal and use the command $ git checkout –B <branch-name> to create a new Git branch.

Step 2: Add the project folder to the stage

In the Git terminal, enter the command $ git add .

Step 3: Check the status

In the Git terminal, enter the command $ git status . This will display a list of details about the commit.

Step 4: Commit the changes

In the Git terminal, enter the command is $ git commit –m "message"

Step 5: Push the changes to the GitHub repository

In the Git terminal enter the command, $ git push –u origin <branch-name>

Step 6: Log in to GitHub and open the repository

Press the Compare and pull request button displayed on the repository page.

Step 7: Create pull request

On the repository page, you’ll see the changes committed. Click the Create and pull request button.

Step 8: Merge pull request

Review the changes and confirm by pressing the Merge pull request button.

Step 9: Log in to the main branch of the local repository

Go back to the Git terminal and enter the command $ git checkout main .

Step 10: Update the main branch

Use the $ git pull command to update the main branch.

You have now successfully committed your project to the remote repository.

Conclusion

In this exercise, you practised the steps for pushing your Android project files to the GitHub repository. You will need to perform this action regularly as you develop your food ordering app.